# 使用官方Python镜像作为基础镜像
FROM python:3.10-slim

# 设置工作目录
WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# 复制项目文件
COPY requirements.txt .
COPY src/ ./src/
COPY config/ ./config/
COPY .streamlit/ ./.streamlit/
# COPY examples/ ./examples/

# 安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt

# 设置环境变量
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

# 修改镜像标签
LABEL maintainer="6Cloud Tech"
LABEL app="TestCaseGPT"
LABEL version="1.0"

# 暴露端口
EXPOSE 8501

# 启动命令
CMD ["streamlit", "run", "src/Home.py"]